<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>折线三次表</title>
    <!-- 引入 echarts.js -->
    <script src="/js/jquery-2.1.1.min.js"></script>
    <script src="/js/echarts.js"></script>

</head>
<body>
<div id="main" style="width: 1200px;height:500px;"></div>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));

    //发起get请求
    $.get('/echars/getSeven', function (data) {
        myChart.setOption({
            xAxis: {data: data.categories},
            series: [{data: data.data1},{data: data.data2},{data: data.data3}]
        })
    });

    option = {
        title: {
            text: '点击量'
        },
        tooltip : {
            trigger: 'axis',
            axisPointer: {
                type: 'cross',
                label: {
                    backgroundColor: '#6a7985'
                }
            }
        },
        legend: {
            data:['日点击量','周点击量','月点击量']
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis : [
            {
                type : 'category',
                boundaryGap : false,
                data : []
            }
        ],
        yAxis : [
            {
                type : 'value'
            }
        ],
        series : [
            {
                name:'日点击量',
                type:'line',
                stack: '总量',
                areaStyle: {},
                data:[]
            },
            {
                name:'周点击量',
                type:'line',
                stack: '总量',
                areaStyle: {},
                data:[]
            },
            {
                name:'月点击量',
                type:'line',
                stack: '总量',
                areaStyle: {},
                data:[]
            }
        ]
    };
    myChart.setOption(option);
  </script>
</body>
</html>